{{extend defaultLayout}}

{{block 'css'}}
<link rel="stylesheet" href="{{@sys.currentPath}}/damage.css">
{{/block}}

{{block 'main'}}
<div class="damage">
  <div class="uid">UID {{uid}}</div>
  <div class="basic">
    <div class="char">
      <div class="avatar">
        <img src="{{charData.role_icon}}" alt="">
      </div>
      <div class="skills">
        <div class="skill">{{charData.skills[0].level}}</div>
        <div class="skill">{{charData.skills[2].level}}</div>
        <div class="skill">{{charData.skills[5].level}}</div>
        <div class="skill">{{charData.skills[1].level}}</div>
        <div class="skill">{{charData.skills[3].level}}</div>
        <div class="skill">{{charData.skills[4].level}}</div>
      </div>
    </div>
    <div class="info">
      <div class="char_info">
        <div class="base">
          <div class="rank rank-icon {{charData.rarity}}"></div>
          <div class="property {{charData.element_str}}"></div>
          <div class="name">{{charData.full_name_mi18n}}</div>
        </div>
        <div class="addition">
          <div class="level">Lv.{{charData.level}}</div>
          <div class="role_ranks r{{charData.rank}}">
            <span></span><span></span><span></span><span></span><span></span><span></span>
          </div>
        </div>
      </div>
      <div class="property_info">
        <div class="title">
          <% include(sys.specialTitle, {en: 'PROPERTY' , cn: '属性' , count: 6 }) %>
        </div>
        {{set basic_properties = charData.basic_properties}}
        <div class="list">
          <div class="properties">
            <div class="prop-icon hpmax"></div>
            <div class="label {{charData.get_label(11102)}}">生命值</div>
            <div class="value">{{basic_properties.hpmax.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon attack"></div>
            <div class="label {{charData.get_label(12102)}}">攻击力</div>
            <div class="value">{{basic_properties.attack.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon def"></div>
            <div class="label {{charData.get_label(13102)}}">防御力</div>
            <div class="value">{{basic_properties.def.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon breakstun"></div>
            <div class="label {{charData.get_label(12202)}}">冲击力</div>
            <div class="value">{{basic_properties.breakstun.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon crit"></div>
            <div class="label {{charData.get_label(20103)}}">暴击率</div>
            <div class="value">{{basic_properties.crit.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon critdam"></div>
            <div class="label {{charData.get_label(21103)}}">暴击伤害</div>
            <div class="value">{{basic_properties.critdam.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon elementabnormalpower"></div>
            <div class="label {{charData.get_label(31402)}}">异常掌控</div>
            <div class="value">{{basic_properties.elementabnormalpower.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon elementmystery"></div>
            <div class="label {{charData.get_label(31203)}}">异常精通</div>
            <div class="value">{{basic_properties.elementmystery.final}}</div>
          </div>
          {{if charData.avatar_profession === 6}}
          <div class="properties">
            <div class="prop-icon sheerforce"></div>
            <div class="label yellow">贯穿力</div>
            <div class="value">{{basic_properties.sheerforce.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon sprecover"></div>
            <div class="label white">闪能累积</div>
            <div class="value">{{basic_properties.adrenalineaccumulate.final}}</div>
          </div>
          {{else}}
          <div class="properties">
            <div class="prop-icon penratio"></div>
            <div class="label {{charData.get_label(23103)}}">穿透率</div>
            <div class="value">{{basic_properties.penratio.final}}</div>
          </div>
          <div class="properties">
            <div class="prop-icon sprecover"></div>
            <div class="label {{charData.get_label(30502)}}">能量回复</div>
            <div class="value">{{basic_properties.sprecover.final}}</div>
          </div>
          {{/if}}
        </div>
      </div>
      <div class="weapon_info">
        {{if charData.weapon}}
        <div class="info">
          <div class="base">
            <div class="rarity-icon {{charData.weapon.rarity}}"></div>
            <div class="name">{{charData.weapon.name}}</div>
          </div>
          <div class="main">
            <div class="addition">
              <div class="star star{{charData.weapon.star}}"></div>
              <div class="level">Lv.{{charData.weapon.level}}</div>
            </div>
            {{each charData.weapon.main_properties prop}}
            <div class="properties">
              <div class="prop-icon {{prop.classname}}"></div>
              <div class="label">{{prop.property_name}}</div>
              <div class="value">{{prop.base}}</div>
            </div>
            {{/each}}
            {{each charData.weapon.properties prop}}
            <div class="properties sub">
              <div class="prop-icon {{prop.classname}}"></div>
              <div class="label">{{prop.property_name}}</div>
              <div class="value">{{prop.base}}</div>
            </div>
            {{/each}}
          </div>
        </div>
        <div class="icon">
          <img src="{{charData.weapon.square_icon}}" alt="">
        </div>
        {{else}}
          <div class="info empty">
            <div class="base">
              <div class="rarity-icon"></div>
              <div class="name"></div>
            </div>
          </div>
          {{/if}}
      </div>
    </div>
  </div>
  <div class="damage-data">
    <div class="title">
      <% include(sys.specialTitle, {en: 'DAMAGE' , cn: '伤害统计' }) %>
    </div>
    <div class="data-list damage-list">
      <div class="tr dmg-tr column4 titlebar no-zzz-font">
        <div class="td dmg-td">%</div>
        <div class="td dmg-td">技能类型</div>
        <div class="td dmg-td">暴击伤害</div>
        <div class="td dmg-td">期望伤害</div>
      </div>
      {{each damages d,index}}
      <div class="tr dmg-tr {{d.result.critDMG !== 0 ? 'column4' : 'column3'}} {{index == skill.index ? 'current' : ''}}">
        <div class="td dmg-td">{{index+1}}</div>
        <div class="td dmg-td no-zzz-font">{{d.skill.name}}</div>
        {{if d.result.critDMG !== 0}}
        <div class="td dmg-td">{{d.result.critDMG.toFixed(0)}}</div>
        {{/if}}
        <div class="td dmg-td">{{d.result.expectDMG.toFixed(0)}}</div>
      </div>
      {{/each}}
      <div class="tr dmg-tr info-tr no-zzz-font">
        <div>伤害计算取有弱点、敌人等级{{charData.level}}、1级基础防御力为50的敌方数据，且不考虑失衡易伤区</div>
        <div>当前指令：<span>{{command}}</span></div>
        <div>下列计算以 <span>{{damage.skill.name}}</span> 为计算目标</div>
        <div>可通过 <span>%{{charData.name_mi18n}}伤害123</span> 切换需要查看的伤害计算</div>
      </div>
    </div>
    <div class="title">
      <% include(sys.specialTitle, {en: 'AREA' , cn: '乘区数据' }) %>
    </div>
    <div class="data-list area-list">
      {{set areas = damage.areas}}
      <div class="tr area-tr titlebar no-zzz-font">
        <div class="td area-td">基础区</div>
        <div class="td area-td">暴击区</div>
        <div class="td area-td">增伤区</div>
        <div class="td area-td">易伤区</div>
        <div class="td area-td">抗性区</div>
        {{if damage.skill.isSheerDMG}}
        <div class="td area-td">贯穿增伤区</div>
        {{else}}
        <div class="td area-td">防御区</div>
        {{/if}}
      </div>
      <div class="tr area-tr titlebar">
        <div class="td area-td">{{(areas.BasicArea || 1).toFixed(0)}}</div>
        <div class="td area-td">{{(areas.CriticalArea || 1).toFixed(2)}}</div>
        <div class="td area-td">{{(areas.BoostArea || 1).toFixed(2)}}</div>
        <div class="td area-td">{{(areas.VulnerabilityArea || 1).toFixed(2)}}</div>
        <div class="td area-td">{{(areas.ResistanceArea || 1).toFixed(2)}}</div>
        {{if damage.skill.isSheerDMG}}
        <div class="td area-td">{{(areas.SheerBoostArea || 1).toFixed(2)}}</div>
        {{else}}
        <div class="td area-td">{{(areas.DefenceArea || 1).toFixed(4)}}</div>
        {{/if}}
      </div>
      {{if damage.skill.isAnomalyDMG}}
      <div class="tr area-tr anomaly titlebar no-zzz-font">
        <div class="td area-td">异常精通区</div>
        <div class="td area-td">异常增伤区</div>
        <div class="td area-td">等级区</div>
      </div>
      <div class="tr area-tr anomaly titlebar">
        <div class="td area-td">{{(areas.AnomalyProficiencyArea || 1).toFixed(2)}}</div>
        <div class="td area-td">{{(areas.AnomalyBoostArea || 1).toFixed(2)}}</div>
        <div class="td area-td">{{(areas.LevelArea || 1).toFixed(2)}}</div>
      </div>
      {{/if}}
      <div class="tr area-tr info-tr no-zzz-font">
        <div>注：一个技能可能分为多个出伤部分分别计算累加，此时该数据仅为一部分的乘区，下同</div>
      </div>
    </div>
    {{if damage.usefulBuffs.length}}
    <div class="title">
      <% include(sys.specialTitle, {en: 'BUFF' , cn: 'Buff统计' }) %>
    </div>
    <div class="data-list buff-list">
      <div class="tr buff-tr titlebar no-zzz-font">
        <div class="td buff-td">%</div>
        <div class="td buff-td">名称</div>
        <div class="td buff-td">来源</div>
        <div class="td buff-td">增益类型</div>
        <div class="td buff-td">增益值</div>
      </div>
      {{each damage.usefulBuffs buff,index}}
      <div class="tr buff-tr titlebar">
        <div class="td buff-td">{{index+1}}</div>
        <div class="td buff-td no-zzz-font">{{buff.name}}</div>
        <div class="td buff-td no-zzz-font">{{buff.source}}</div>
        <div class="td buff-td no-zzz-font">{{buff.type}}</div>
        <div class="td buff-td">{{buff.value < 2 ? ((buff.value * 100).toFixed(0) + '%') : (buff.value % 1 === 0 ? buff.value : buff.value.toFixed(2))}}</div>
      </div>
      {{/each}}
    </div>
    {{/if}}
    {{if sub_differences.length > 1}}
    <div class="title">
      <% include(sys.specialTitle, {en: 'SUBSTAT' , cn: '副词条差异计算' }) %>
    </div>
    <div class="data-list difference-list">  
      <div class="tr difference-tr d{{sub_differences[0].length}}">
        <div class="td difference-td no-zzz-font">词条变化</div>
        {{each sub_differences[0] d}}
        <div class="td difference-td no-zzz-font">
          {{d.add.shortName}}
          <span>+{{d.add.valueBase}}</span>
        </div>
        {{/each}}
      </div>
      {{each sub_differences diff}}
      <div class="tr difference-tr d{{sub_differences[0].length}}">
        <div class="td difference-td no-zzz-font">
          {{diff[0].del.shortName}}
          <span>-{{diff[0].del.valueBase}}</span>
        </div>
        {{each diff d}}
        <div class="td difference-td no-zzz-font {{d.difference > 0 ? 'positive' : d.difference < 0 ? 'negative' : 'zero'}}">{{d.difference > 0 ? '+' + d.difference.toFixed(0) : d.difference.toFixed(0)}}</div>
        {{/each}}
      </div>
      {{/each}}
      <div class="tr difference-tr info-tr no-zzz-font">
        <div>反映在上述buff作用下置换<span>单位副词条</span>后的<span>{{skill.name}}</span>期望伤害变化</div>
        <div><span>横轴</span>表示<span>增加</span>的词条，<span>纵轴</span>表示<span>减少</span>的词条，对应坐标即为<span>期望伤害变化</span>，下同</div>
      </div>
    </div>
    {{/if}}
    {{if main_differences.length > 1}}
    <div class="title">
      <% include(sys.specialTitle, {en: 'MAINSTAT' , cn: '主词条差异计算' }) %>
    </div>
    <div class="data-list difference-list">  
      <div class="tr difference-tr d{{main_differences[0].length}}">
        <div class="td difference-td no-zzz-font">词条变化</div>
        {{each main_differences[0] d}}
        <div class="td difference-td no-zzz-font">
          {{d.add.shortName}}
          <span>+{{d.add.valueBase}}</span>
        </div>
        {{/each}}
      </div>
      {{each main_differences diff}}
      <div class="tr difference-tr d{{main_differences[0].length}}">
        <div class="td difference-td no-zzz-font">
          {{diff[0].del.shortName}}
          <span>-{{diff[0].del.valueBase}}</span>
        </div>
        {{each diff d}}
        <div class="td difference-td no-zzz-font {{d.difference > 0 ? 'positive' : d.difference < 0 ? 'negative' : 'zero'}}">{{d.difference > 0 ? '+' + d.difference.toFixed(0) : d.difference.toFixed(0)}}</div>
        {{/each}}
      </div>
      {{/each}}
      <div class="tr difference-tr info-tr no-zzz-font">
        <div>反映在上述buff作用下置换<span>单位主词条</span>后的<span>{{skill.name}}</span>期望伤害变化</div>
        <div>量化<span>不同主词条组合</span>对伤害的影响，但并非每个组合都可实现，仅供参考</div>
      </div>
    </div>
    {{/if}}
  </div>
</div>
{{/block}}
